 <meta charset="utf-8">
<div class="box box-primary" id="app_authRole_add">
            <form role="form" id="editForm">
              <div class="box-body" style="overflow: hidden;">
              
               <div class="form-group">
                  <label for="roleCode">角色编码</label>
                  <input type="text"  v-model="authRole.roleCode" name="roleCode" class="form-control" id="roleCode" placeholder="请输入角色编码"  required aria-required="true" >
                </div> 
                
                 <div class="form-group">
                  <label for="name">角色名称</label>
                  <input type="text" name="name"   v-model="authRole.name"  class="form-control" id="name" placeholder="请输入角色名称" required>
                </div> 
                
                   <div class="form-group">
					<label for="appKey" class="control-label">所属应用</label>
                  	<select id="appKey" v-model="authRole.appKey" name="appKey" v-kselect="{url:'auth/authApp/loadAuthAppComboboVo',vmodel:'authRole.appKey',firstEmpty:'true'}" class=" form-control"   required> </select>
				</div> 
                
                <div class="form-group">
                  <label for="enabled" >是否启用</label>
                  <select v-model="authRole.enabled" id="enabled" name="enabled"  class="form-control"  required >
                    <option value="true">启用</option>
                    <option value="false">禁用</option>
                  </select>
                </div>
                 
                 <div class="form-group">
                  <label for="description">角色描述</label>
                  <input type="description"   v-model="authRole.description"  class="form-control" id="description" v-model="description"  >
                </div> 
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                 <button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
                 <button type="button" class="btn btn-info pull-right"  v-on:click="add">提交</button>
              </div>
            </form>

<script type="text/javascript">
var vm = new Vue({
        el: '#app_authRole_add',
        data: {
        	authRole:{
        			roleCode: '',
        			name: '',
        			enabled: '',
        			appKey:'',
        			description: ''
        		 },
        	    bus:new Vue()
        },
         methods: {
        	 add: function () {
        	    	if($("#editForm").valid()){
        	    		let _this=this;
        	    		var url="/auth/authRole/addRole";
        	    		zfesAjax.ajaxTodo(url,_this.$data.authRole, function(data){
        	    			alertSwal.successText(data.message);
        	    			 layer.close(layer.index);
        	    		})
        	    	}
        	    },
        	    cancle:function(){
        	    	 layer.close(layer.index);
        	    	 
        	    }
        }
    })

 </script>
</div>